<template>
  <section>

    <van-list
            v-model="loading"
            :finished="finished"
            finished-text="没有更多了"
            @load="onLoad"
    >
      <!-- <van-cell v-for="(item, index) in dataType" :key="item" :title="index" /> -->
      <!--<div class="detail-form-list-div"  v-for="(item, index) in dataType" :key="index">-->

      <!--</div>-->
      <div class="facility-detail-tab"  v-for="(item, index) in dataType" :key="index">
        <div class="facility-detail-tab-top">
          <div class="facility-detail-tab-top-left">
            <img class="facility-detail-tab-top-img" src="../../../../../assets/icon-time.png" />
            <div>{{item.submitTime}}</div>
            <img class="facility-detail-tab-top-img2" src="../../../../../assets/icon-tel.png" />
          </div>
          <div @click="showChange2(index, item.id)">
            <img class="facility-detail-tab-top-img3-t" v-if="index == tabIdx" src="../../../../../assets/icon-bottom.png" />
            <img class="facility-detail-tab-top-img3" v-else src="../../../../../assets/icon-bottom.png" />
          </div>
        </div>

        <div  v-if="index == tabIdx">

          <div class="facility-title">
            <div @click="idxChange(0)" :class="{'facility-active': titleIdx === 0}">白班交接</div>
            <div class="facility-title-line"></div>
            <div @click="idxChange(1)" :class="{'facility-active': titleIdx === 1}">夜班交接</div>
          </div>
          <div class="facility-detail-tps"  v-show="titleIdx === 0">
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">大缸体:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult1}}</div>
            </div>
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">小缸体:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult2}}</div>
            </div>
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">实验室:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult3}}</div>
            </div>
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">企鹅:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult4}}</div>
            </div>
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">水母:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult5}}</div>
            </div>
          </div>
          <div class="facility-detail-tps"  v-show="titleIdx === 1">
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">大缸体:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult1}}</div>
            </div>
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">小缸体:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult2}}</div>
            </div>
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">实验室:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult3}}</div>
            </div>
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">企鹅:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult4}}</div>
            </div>
            <div class="facility-detail-tps-div-t">
              <div class="facility-detail-tps-div-name">水母:</div>
              <div  class="facility-detail-tps-div-msg">{{resultDetail.dayShiftResult5}}</div>
            </div>
            <div class="addFeed-tab">
              <div class="addFeed-tab-time">
                <div class="addFeed-con-msg">
                    <van-dropdown-menu>
                        <van-dropdown-item v-model="value" :options="opt" />
                    </van-dropdown-menu>
                </div>
              </div>
              <div>
                <div class="addFeed-status">
                  <div class="addFeed-status-left"><span>设备状态</span><span>:</span></div>
                  <div class="detail-form-list-con-div-con">

                      <div class="detail-true" v-if="true"></div>
                      <div class="detail-boolen" v-else></div>
                      正常
                  </div>
                  <div class="detail-form-list-con-div-con">

                      <div class="detail-false" v-if="false"></div>
                      <div class="detail-boolen" v-else></div>
                      异常
                  </div>
                </div>
                <div class="addFeed-status">
                  <div class="addFeed-status-left"><span>生物状态</span><span>:</span></div>
                  <div class="detail-form-list-con-div-con">

                      <div class="detail-true" v-if="true"></div>
                      <div class="detail-boolen" v-else></div>
                      正常
                  </div>
                  <div class="detail-form-list-con-div-con">

                      <div class="detail-false" v-if="false"></div>
                      <div class="detail-boolen" v-else></div>
                      异常
                  </div>
                </div>
                <div class="addFeed-status">
                  <div class="addFeed-status-left"><span>循环状态</span><span>:</span></div>
                  <div class="detail-form-list-con-div-con">

                      <div class="detail-true" v-if="false"></div>
                      <div class="detail-boolen" v-else></div>
                      正常
                  </div>
                  <div class="detail-form-list-con-div-con">

                      <div class="detail-false" v-if="true"></div>
                      <div class="detail-boolen" v-else></div>
                      异常
                  </div>
                </div>
                <div class="addFeed-status">
                  <div class="addFeed-status-left"><span>备</span><span>注:</span></div>
                  <textarea class="addFeed-text" placeholder="股市过热和埃尔特和"></textarea>
                </div>
              </div>
            </div>
          </div>
          <div class="facility-detail-tab-top-line2"></div>
          <div class="detail-form-tipscon">
            <div class="detail-form-tips-con">操作人:{{resultDetail.dayShiftResult1UpdateUser}}</div>
            <div class="detail-form-tips-con">报表来源:来源<span v-if="resultDetail.dayShiftResult1Source == 0">移动端</span><span v-else>pc端</span></div>
          </div>
          <div class="detail-form-tipscon">
            <div class="detail-form-tips-con">操作人:{{resultDetail.dayShiftResult2UpdateUser}}</div>
            <div class="detail-form-tips-con">报表来源:来源<span v-if="resultDetail.dayShiftResult2Source == 0">移动端</span><span v-else>pc端</span></div>
          </div>
          <div class="detail-form-tipscon">
            <div class="detail-form-tips-con">操作人:{{resultDetail.dayShiftResult3UpdateUser}}</div>
            <div class="detail-form-tips-con">报表来源:来源<span v-if="resultDetail.dayShiftResult3Source == 0">移动端</span><span v-else>pc端</span></div>
          </div>
          <div class="detail-form-tipscon">
            <div class="detail-form-tips-con">操作人:{{resultDetail.dayShiftResult4UpdateUser}}</div>
            <div class="detail-form-tips-con">报表来源:来源<span v-if="resultDetail.dayShiftResult4Source == 0">移动端</span><span v-else>pc端</span></div>
          </div>
          <div class="detail-form-tipscon">
            <div class="detail-form-tips-con">操作人:{{resultDetail.dayShiftResult5UpdateUser}}</div>
            <div class="detail-form-tips-con">报表来源:来源<span v-if="resultDetail.dayShiftResult5Source == 0">移动端</span><span v-else>pc端</span></div>
          </div>
          <div class="detail-form-tipscon">
            <div class="detail-form-tips-con">操作人:{{resultDetail.nightShiftUpdateUser}}</div>
            <div class="detail-form-tips-con">报表来源:来源<span v-if="resultDetail.nightShiftSource == 0">移动端</span><span v-else>pc端</span></div>
          </div>
        </div>
        <div class="facility-detail-tab-top-line"  v-show="index !== tabIdx"></div>
        <div class="facility-detail-tabs"  v-show="index !== tabIdx">
          <div class="facility-detail-tabs-ts">
            <div class="facility-detail-tabs-name">
              <div><span class="facility-detail-tabs-name-span">填写人：</span>{{item.dayShiftResult1UpdateUser}}</div>
              <div class="facility-detail-tabs-line"></div>
            </div>
            <div class="facility-detail-tabs-t">{{item.dayShiftResult1UpdateTime}}</div>
          </div>
         <div class="facility-detail-tabs-ts">
            <div class="facility-detail-tabs-name">
              <div><span class="facility-detail-tabs-name-span">填写人：</span>{{item.dayShiftResult2UpdateUser}}</div>
            </div>
            <div class="facility-detail-tabs-t">{{item.dayShiftResult2UpdateTime}}</div>
          </div>
          <div class="facility-detail-tabs-ts">
            <div class="facility-detail-tabs-name">
              <div><span class="facility-detail-tabs-name-span">填写人：</span>{{item.dayShiftResult3UpdateUser}}</div>
            </div>
            <div class="facility-detail-tabs-t">{{item.dayShiftResult3UpdateTime}}</div>
          </div>
          <div class="facility-detail-tabs-ts">
            <div class="facility-detail-tabs-name">
              <div><span class="facility-detail-tabs-name-span">填写人：</span>{{item.dayShiftResult4UpdateUser}}</div>
            </div>
            <div class="facility-detail-tabs-t">{{item.dayShiftResult4UpdateTime}}</div>
          </div>
          <div class="facility-detail-tabs-ts">
            <div class="facility-detail-tabs-name">
              <div><span class="facility-detail-tabs-name-span">填写人：</span>{{item.dayShiftResult5UpdateUser}}</div>
            </div>
            <div class="facility-detail-tabs-t">{{item.dayShiftResult5UpdateTime}}</div>
          </div>
          <div class="facility-detail-tabs-ts">
            <div class="facility-detail-tabs-name">
              <div><span class="facility-detail-tabs-name-span">填写人：</span>{{item.nightShiftUpdateUser}}</div>
            </div>
            <div class="facility-detail-tabs-t">{{item.nightShiftUpdateTime}}</div>
          </div>
        </div>

      </div>
    </van-list>
  </section>
</template>

<script>
import { getDate } from '../../../../../api/unit.js'
export default {
  props: {
    dataType: Array,
    tabIdx: Number,
    pageCount: Number,
    pageSize: Number,
    resultDetail: Object
  },
  data () {
    return {
      loading: false,
      finished: false,
      titleIdx: 0,
      opt: [
        {
          text: '5:30',
          value: '5:30'
        }
      ],
      value: '5:30',
      nightShiftPatrol: []
    }
  },
  mounted(){
    console.log('====>', this.resultDetail)
  },
  filters: {
    format: function (value) {
      return getDate(value).nTime
    }
  },
  methods: {
    onLoad () {
      setTimeout(() => {
        if (this.dataType.length < this.pageCount && this.pageCount > this.pageSize) {
          this.pageChange()
        }
        // 加载状态结束
        this.loading = false

        // 数据全部加载完成
        if (this.dataType.length >= this.pageCount) {
          this.finished = true
        }
      }, 1000)
    },
    showChange2 (index, id) {
      this.$emit('showChange', index, id, 13)
    },
    pageChange () {
      this.$emit('pageChange')
    },
    idxChange(idx){
      this.titleIdx =idx
    }
  }
}
</script>

<style scoped>
  .facility-detail-tab{
    margin-top: 16px;
    background: #fff;
    width: 690px;
    border-radius: 10px;
  }
  .facility-detail-tab-top{
    height: 95px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 32px;
    color: #9E9E9E;
    width: 690px;
  }
  .facility-detail-tab-top-left{
    display: flex;
    align-items: center;
  }
  .facility-detail-tab-top-img{
    width: 35px;
    height: 35px;
    margin-left: 37px;
    margin-right: 19px;
  }
  .facility-detail-tab-top-img2{
    width: 14px;
    height: 20px;
    margin-left: 23px;
  }
  .facility-detail-tab-top-img3{
    width: 22px;
    height: 12px;
    margin-right: 54px;
  }
  .facility-detail-tab-top-img3-t{
    width: 22px;
    height: 12px;
    margin-right: 54px;
    transform: rotate(180deg);
  }
  .facility-detail-tab-top-line{
    width:690px;
    height:2px;
    background: #000;
    opacity:0.14;
  }
  .facility-detail-tab-top-line2{
    width:590px;
    margin-left: 50px;
    height:1px;
    background: #000;
    opacity:0.14;
    margin-top: 38px;
  }
  .facility-detail--con{
    color: #202020;
    font-size: 30px;
    font-weight: bold;
    margin-left: 50px;
    margin-top: 45px;
  }
  .facility-detail-tabs{

  }
  .facility-active{
    color: #202020;
  }
  .facility-detail-tabs-ts{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 14px 24px 9px 0;
    line-height: 57px;
  }
  .facility-detail-tabs-name{
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 34px;
    width: 307px;
    color: #202020;
    margin-left: 38px;
  }
  .facility-detail-tabs-name-span{
    color: #646464;
    font-size: 30px;
  }
  .facility-detail-tabs-line{
    width:2px;
    height:80px;
    opacity:0.14;
    background: #000;
  }
  .facility-detail-tabs-tips{
    font-size: 26px;
    color: #9E9E9E;
    padding: 7px 12px;
    border: 2px solid #DEDBDE;
    border-radius:6px;
    margin-right: 13px;
  }
  .facility-detail-tabs-t{
    color: #9e9e9e;
    font-size: 32px;
    letter-spacing: 3px;
    text-align: right;
  }
  .facility-detail-tps{
    /*width: 590px;*/
    margin-left: 50px;
    display: flex;
    flex-wrap: wrap;
  }
  .facility-detail-tps-div{
    display: flex;
    margin-top: 29px;
    width: 285px;
    padding-left: 16px;
    font-size: 26px;
  }
  .facility-detail-tps-div-name{
    color: #202020;
    margin-right: 30px;
  }
  .facility-detail-tps-div-msg{
    color: #9E9E9E;
  }
  .facility-detail-tps-div-t{
    width: 500px;
    font-size: 26px;
    display: flex;
    padding-left: 16px;
    margin-top: 32px;
  }
  .detail-form-tipscon{
    margin-left: 50px;
    display: flex;
    font-size: 26px;
    color: #9e9e9e;
    margin-top: 20px;
    padding-bottom: 20px;
  }
  .detail-form-tips-con{
    width: 300px;
  }
  .facility-title{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 612px;
    height: 60px;
    font-size: 28px;
    color: #9e9e9e;
    border:1px solid #DBDADD;
    border-radius: 30px;
    margin-left: 36px;
  }
  .facility-title-line{
    width: 1px;
    height: 30px;
    background: #DBDADD;
    margin-left: 105px;
    margin-right: 105px;
  }
  .addFeed-tab{
    border: 1px solid #DFDCDD;
    width: 610px;
    margin-top: 57px;
    margin-left: -11px;
    overflow: hidden;
  }
  .addFeed-tab-time{
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    text-align: center;
    border-bottom: 1px solid #DFDCDD;
    color: #202020;
    font-size: 30px;
    letter-spacing: 3px;
  }
  .van-dropdown-menu{
    background: none;
  }
  .addFeed-status{
    display: flex;
    align-items: center;
    color: #202020;
    font-size: 26px;
  }
  .addFeed-status-left{
    width: 130px;
    margin-left: 21px;
    display: flex;
    justify-content: space-between;
  }
  .detail-form-list-con-div-con{
    display: flex;
    width: 130px;
    align-items: baseline;
    justify-content: center;
   /* align-items: flex-start;
    justify-items: center; */
    margin-left: 60px;
    margin-top: 19px;
  }
  .detail-true{
    width:20px;
    height:20px;
    background: #0FBD9D;
    border-radius:50%;
    margin-right: 5px;
  }
  .detail-false{
    width:20px;
    height:20px;
    background: #FF8D17;
    border-radius:50%;
    margin-right: 5px;
  }
  .detail-boolen{
    width:20px;
    height:20px;
    border:2px solid rgba(229,229,229,1);
    border-radius:50%;
    margin-right: 5px;
  }
  .addFeed-text{
    width: 348px;
    border: 1px solid #CECED0;
    background: #F9F9FB;
    margin-left: 41px;
    margin-top: 25px;
    margin-bottom: 20px;
    padding: 10px 21px;
  }
</style>
